<template>
  <div class="shoptel-content">
    <van-cell-group>
      <van-field v-model="value" placeholder="请输入联系方式"/>
    </van-cell-group>
    <div class="yesbtn" @click="Suk_editshoptel">确认修改</div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      value: ""
    };
  },
  beforeCreate: function() {
    //创建前
  },
  created: function() {
    //创建后
  },
  beforeMount: function() {
    //挂载前
  },
  mounted: function() {
    //挂载后
  },
  beforeUpdate: function() {
    //更新前
  },
  update: function() {
    //更新后
  },
  methods: {
    Suk_editshoptel() {
      let that = this;
      that.$toast.loading({
        message: "加载中..."
      });
      var Sukdata = {
//      id:localStorage.getItem('storeid'),
				userid: localStorage.getItem("userid"),
        phone:that.value
      };
      console.log(Sukdata);
      that.axios
        .post(that.baseUrl + "/dining/updateImages", that.Qs.stringify(Sukdata), {
          headers: {
            "Content-Type": "application/x-www-form-urlencoded"
          }
        })
        .then(function(res) {
          if (res.data.meta.code == -1) {
//            console.log(res.data);
              that.$toast.success({
                message: "商家不存在！"
              });
            } else if (res.data.meta.code == 1) {
            	that.$toast.success({
                message: "修改成功！"
              });
              that.$router.go(-1)
            }else if (res.data.meta.code == -2) {
            	that.$toast.success({
                message: "修改失败！"
              });
          }
        });
    }
  }
};
</script>
<style lang="scss" scoped>
.yesbtn {
  width: 85%;
  background: #fda229;
  font-size: 0.5rem;
  text-align: center;
  margin: 0 auto;
  margin-top: 1.5rem;
  border-radius: 0.5rem;
  color: #fff;
  height: 1.1rem;
  line-height: 1.1rem;
}
</style>